#ifndef _HTTPSERVER_HPP_
#define _HTTPSERVER_HPP_

#include "jhdefs.hpp"
#include "types.hpp"
#include "net/TCPServer.hpp"
#include "net/ServerSocket.hpp"
#include "net/HTTPRequestHandler.hpp"
#include "net/HTTPServerParams.hpp"


NET_NAMESPACE_BEGIN

class CHTTPServer : public CTCPServer
{
public:
	CHTTPServer(CHTTPRequestHandlerFactory::Ptr pFactory, UInt16 portNumber = 80, CHTTPServerParams::Ptr pParams = new CHTTPServerParams);
	CHTTPServer(CHTTPRequestHandlerFactory::Ptr pFactory, const CServerSocket& socket, CHTTPServerParams::Ptr pParams);
	CHTTPServer(CHTTPRequestHandlerFactory::Ptr pFactory, CThreadPool& threadPool, const CServerSocket& socket, CHTTPServerParams::Ptr pParams);
	~CHTTPServer();
	void stopAll(bool abortCurrent = false);

private:
	CHTTPRequestHandlerFactory::Ptr m_pFactory;
};


NET_NAMESPACE_END

#endif
